home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
pluginy Firefox
/
1833
/
1833.xpi
/
components
/
yoonoWebAPI.js
< prev
Wrap
Text File
|
2009-12-16
|
2KB
|
74 lines
const SERVICE_NAME = "Yoono Web API";
const SERVICE_CID = Components.ID("{51b3c79b-aa74-4785-917d-c1f8a47e5210}");
const SERVICE_CTRID = "@yoono.com/webapi;1";
const CC = Components.classes;
const CI = Components.interfaces;
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
//class constructor
function YoonoWebAPI() {
var extId = '{d9284e50-81fc-11da-a72b-0800200c9a66}';
var extmgr = Components.classes['@mozilla.org/extensions/manager;1'].getService(Components.interfaces.nsIExtensionManager);
this.version = extmgr.getItemForID(extId).version;
}
// class definition
YoonoWebAPI.prototype = {
classDescription: SERVICE_NAME,
classID: SERVICE_CID,
contractID: SERVICE_CTRID,
_xpcom_categories: [{
category: "JavaScript global property",
entry: "yoonoapi",
value: SERVICE_CTRID
}],
QueryInterface: XPCOMUtils.generateQI([CI.nsISecurityCheckedComponent,
CI.yoonoIWebAPI,
CI.nsIClassInfo]),
// nsIClassInfo
getInterfaces: function(aCount) {
var result = [CI.nsISecurityCheckedComponent,
CI.yoonoIWebAPI,
CI.nsIClassInfo];
aCount.value = result.length;
return result;
},
getHelperForLanguage: function(aLanguage) {
return null;
},
// nsISecurityCheckedComponent
canCreateWrapper: function(aIID) {
return "AllAccess";
},
canCallMethod: function(aIID, methodName) {
return "NoAccess";
},
canGetProperty: function(aIID, propertyName) {
switch (propertyName) {
case "version":
return "AllAccess";
}
return "NoAccess";
},
canSetProperty: function(aIID, propertyName) {
return "NoAccess";
}
};
var components = [YoonoWebAPI];
function NSGetModule(compMgr, fileSpec) {
return XPCOMUtils.generateModule(components);
}